#pragma once
#include "People.h"

class Node
{
public:
	People* Data;
	Node* next;

	static void add(Node* &head, Node* &element);
	static void addData(Node* &head, People* people);
	static void remove(Node* &head);
	//Sorting
	static void merge_sort(Node* &head, int (*compare)( Node*&,  Node*&));
	~Node();
private:
	static Node* split_half(Node* head);
	static Node* merge(Node* head1, Node* head2, int (*compare)( Node*&,  Node*&));
};

class Class
{
	Node* head;
public:
	Class();
	void PrintInfo();
	void PrintInfo(ostream &out);
	void PrintStudentInfo(int score);
	void AddPeople(People* &people);
	void sort();
	void saveToFile(char* filename);
	void loadFile(char* filename);
	~Class();
private:
	static int compare(Node*& node1, Node*& node2);
};
